#include <iostream>

#include "DataSvr.h"
 
using std::cout;
using std::endl;

int g_my_ds_id;
string g_log_conf_file;

int parse_args(int argc, char * argv[]) {
	char c;
	while(-1 != (c = getopt(argc, argv, "i:l:"))) {
		switch(c) {
			case 'i':
				g_my_ds_id = atoi(optarg);
				break;
			case 'l':
				g_log_conf_file = optarg;
				break;
	
			default:
				break;
		}
	}
}

int main(int argc, char * argv[]) {
	parse_args(argc, argv);
	DataSvr ds;
	int ret = ds.init(g_log_conf_file.c_str(), g_my_ds_id, "127.0.0.1", 3501, 30, 2, 10, 10, -1);
	if (ret < 0) {
		cout << "could not init data svr, ret:" << ret << endl;
		return -1;
	}
	ds.start();
}
